﻿using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using 基于WPF的电缆采样数据分析系统.MsgEvents.DeviceStatus;

namespace 基于WPF的电缆采样数据分析系统.Views.DeviceStatus
{
    /// <summary>
    /// ColumnTwoUC.xaml 的交互逻辑
    /// </summary>
    public partial class ColumnTwoUC : UserControl
    {

        /// <summary>
        /// 发布订阅
        /// </summary>
        private readonly IEventAggregator Aggregator;


        public ColumnTwoUC()
        {
            InitializeComponent();

            Aggregator = App.GetService<IEventAggregator>();
            Aggregator.GetEvent<MsgIsFileUsed>().Subscribe(MsgIsFileUsedFun);

            if (GlobalVariableEdit.UsedFileLogList.Count != 0)
            {
                MsgIsFileUsedFun();
            }
            
        }

        /// <summary>
        /// 有文件操作再进行显示
        /// </summary>
        private void MsgIsFileUsedFun()
        {
            lvcChart.Visibility = Visibility.Visible;
            ShowText.Visibility = Visibility.Collapsed;
        }
    }
}
